package com.qingke.ssh.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.qingke.ssh.bean.Student;
import com.qingke.ssh.bean.StudentLogin;
import com.qingke.ssh.dao.StudentDao;

@Service
@Transactional
public class StudentService {
	@Autowired
	private StudentDao studentdao;

	public Student login(String username, String password) {
		StudentLogin studentLogin = studentdao.login(username, password);
		if (studentLogin == null) {
			return null;
		}
		return studentLogin.getStudent();
	}
}
